package net.rock.eshop.mapper;

import net.rock.eshop.entity.Order;
import net.rock.eshop.entity.OrderBook;
import net.rock.eshop.entity.SalesVol;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {
    List<Order> fetchAllOrders();
    List<Order> fetchOrdersByUserId(int userId);
    List<OrderBook> fetchOrderBookByOrderId(String orderId);

    void add(Order order);
    void insertOrderBook(@Param("orderId") String orderId,
                         @Param("bookId") int bookId,
                         @Param("cnt") int cnt);

    void delOrder(String id);
    void delOrderBooks(String id);
    void pay(String id);
    void send(String id);
    void confirm(String id);

}
